home *** CD-ROM | disk | FTP | other *** search
/ Quick PC 62 / Quick PC 62.iso / I386 / IIS5_01.CAB / IIS_asps4pim.asp < prev    next >
Encoding:
Text File  |  1999-07-29  |  3.8 KB  |  64 lines

  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
  2. <HTML>
  3. <HEAD>
  4. <META HTTP-EQUIV="Content-Type" Content="text/html; charset=Windows-1252">
  5. <TITLE>Basic Transaction</TITLE>
  6. <SCRIPT LANGUAGE="JavaScript">
  7. <!--
  8.     TempString = navigator.appVersion
  9.     if (navigator.appName == "Microsoft Internet Explorer"){    
  10. // Check to see if browser is Microsoft
  11.         if (TempString.indexOf ("4.") >= 0){
  12. // Check to see if it is IE 4
  13.             document.writeln('<link rel="stylesheet" type="text/css" href="/iishelp/common/coua.css">');
  14.         }
  15.         else {
  16.             document.writeln('<link rel="stylesheet" type="text/css" href="/iishelp/common/cocss.css">');
  17.         }
  18.     }
  19.     else if (navigator.appName == "Netscape") {                        
  20. // Check to see if browser is Netscape
  21.         document.writeln('<link rel="stylesheet" type="text/css" href="/iishelp/common/coua.css">');
  22.     }
  23.     else
  24.         document.writeln('<link rel="stylesheet" type="text/css" href="/iishelp/common/cocss.css">');
  25. //-->
  26. </script>
  27. <SCRIPT LANGUAGE="VBScript">
  28. <!--
  29. Sub Window_OnLoad()
  30.    Dim frmContents
  31.    On Error Resume Next
  32.    If Not Parent Is Nothing Then
  33.       Set frmContents = Parent.Contents
  34.       If Not frmContents Is Nothing Then
  35.             frmContents.Window.TOCSynch_Click
  36.       End If
  37.    End If
  38. End Sub
  39. //--></SCRIPT><META NAME="DESCRIPTION" CONTENT="Internet Information Services reference information">
  40. <META HTTP-EQUIV="PICS-Label" CONTENT='(PICS-1.1 "<http://www.rsac.org/ratingsv01.html>" l comment "RSACi North America Server" by "inet@microsoft.com <mailto:inet@microsoft.com>" r (n 0 s 0 v 0 l 0))'>
  41. <META NAME="MS.LOCALE" CONTENT="EN-US">
  42. <META NAME="MS-IT-LOC" Content="Internet Information Services"> 
  43. </HEAD>
  44.  
  45. <BODY BGCOLOR="#FFFFFF" TEXT="#000000">
  46.  
  47. <H2><A NAME="_basic_transaction"></A><SUP> <% If Request("DontFrame")<>1 Then Response.Redirect "/iissamples/sdk/asp/docs/SampFram.asp?ovfile=/iishelp/iis/htm/asp/asps4pim.asp&srcfile=Transactional/SimpleTransaction" %></SUP>Basic Transaction</H2>
  48.  
  49. <H6>Overview</H6>
  50.  
  51. <P>Using ASP, you can easily take advantage of the reliability provided by Component Services. To do so you only need to include the @TRANSACTION directive in your script. This directive tells Component Services that any changes occurring in the page, such as database manipulation or Message Queuing message transmission, should be considered transactions. A change that is being managed by transaction services can either be committed which would make the change permanent, or aborted the latter would result in the database or queue being rolled back to its previous state, before the changes were made.</P>
  52.  
  53. <H6>Code Tour</H6>
  54.  
  55. <P>In this sample, the entire page has been declared a transaction, by use of the @TRANSACTION directive. The sample provides some scripting commands for two other procedures that are called to perform additional completion or clean-up tasks. <B>OnTransactionCommit </B>is called either when the script has successfully completed, or the <B>ObjectContext.SetComplete</B> method has been called. Likewise, <B>OnTransactionAbort</B> is called either when the script encounters some kind of processing error, or the <B>ObjectContext.SetAbort</B> method has been called.</P>
  56.  
  57. <P>This sample commits by default, since it simply prints a small message and then exits. Since the directive declared the script to be a transaction, exiting successfully automatically commits changes made in the script (although in this case there are none), and triggers the <B>OnTransactionCommit</B> procedure, which prints a message.</P>
  58.  
  59. <P><B><B>Important   </B></B>The @TRANSACTION directive must be on the first line of the .asp file, or an error will be generated.</P>
  60. <hr class="iis" size="1">
  61. <p align="center"><em><a href="../../../common/colegal.htm">© 1997-1999 Microsoft Corporation. All rights reserved.</a></em></p>
  62. </BODY>
  63. </HTML>
  64.